app.service('addressService',function($http){
    //发现地址详情
   this.findOne=function (id) {
        return $http.get("./addressController/findOne.do?id="+id);
   }
   //设置默认地址
   this.isDefault=function (id) {
        return $http.get("./addressController/isDefault.do?id="+id);
   }
   // 添加地址
    this.add=function (dpAddress) {
        return $http.post("./addressController/add.do",dpAddress);
    }
    // 更新地址
    this.update=function (dpAddress) {
        return $http.post("./addressController/update.do",dpAddress);
    }
    //删除地址
    this.delete=function (id) {
        return $http.get("./addressController/delete.do?id="+id);
    }
    //查询全部地址
    this.findAll=function () {
        return $http.get("./addressController/findAll.do");
    }
    //查询省级地址
    this.findProvinces=function () {
        return $http.get("./addressController/findProvinces.do");
    }
    //查询市级地址
    this.findCity=function (provinceId) {
        return $http.get("./addressController/findCity.do?provinceId="+provinceId);
    }
    //查询市级地址
    this.findArea=function (cityId) {
        return $http.get("./addressController/findArea.do?cityId="+cityId);
    }
});